home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kpixmapprovider.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  1.8 KB  |  56 lines

  1. /* This file is part of the KDE libraries
  2.  
  3.    Copyright (c) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
  4.  
  5.    This library is free software; you can redistribute it and/or
  6.    modify it under the terms of the GNU Library General Public
  7.    License (LGPL) as published by the Free Software Foundation; either
  8.    version 2 of the License, or (at your option) any later version.
  9.  
  10.    This library is distributed in the hope that it will be useful,
  11.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.    Library General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU Library General Public License
  16.    along with this library; see the file COPYING.LIB.  If not, write to
  17.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.    Boston, MA 02110-1301, USA.
  19. */
  20.  
  21. #ifndef KPIXMAPPROVIDER_H
  22. #define KPIXMAPPROVIDER_H
  23.  
  24. #include <qpixmap.h>
  25. #include "kdelibs_export.h"
  26.  
  27. /**
  28.  * A tiny abstract class with just one method:
  29.  * pixmapFor()
  30.  *
  31.  * It will be called whenever an icon is searched for @p text.
  32.  *
  33.  * Used e.g. by KHistoryCombo
  34.  *
  35.  * @author Carsten Pfeiffer <pfeiffer@kde.org>
  36.  * @short an abstract interface for looking up icons
  37.  */
  38. class KDECORE_EXPORT KPixmapProvider
  39. {
  40. public:
  41.     virtual ~KPixmapProvider();
  42.     /**
  43.      * You may subclass this and return a pixmap of size @p size for @p text.
  44.      * @param text the text that is associated with the pixmap
  45.      * @param size the size of the icon in pixels, 0 for defaylt size.
  46.      *             See KIcon::StdSize.
  47.      * @return the pixmap for the arguments, or null if there is none
  48.      */
  49.     virtual QPixmap pixmapFor( const QString& text, int size = 0 ) = 0;
  50. protected:
  51.     virtual void virtual_hook( int id, void* data );
  52. };
  53.  
  54.  
  55. #endif // KPIXMAPPROVIDER_H
  56.